﻿

using IotContract.Models.Process;
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotContract.Models.Jobs;
[ProtoContract]
public class ScEnterJob:ProcessBaseData
{
    /// <summary>
    /// 设备编号
    /// </summary>
    [ProtoMember(1)]
    public int EquipNum { get; set; }

    /// <summary>
    /// 堆垛机站台
    /// </summary>
    [ProtoMember(2)]
    public int FromStation { get; set; }
    /// <summary>
    /// 站台号
    /// </summary>
    [ProtoMember(3)]
    public int FromTagNumber { get; set; }
    /// <summary>
    /// 排
    /// </summary>
    [ProtoMember(4)]
    public int ToBank { get; set; }
    /// <summary>
    /// 列
    /// </summary>
    [ProtoMember(5)]
    public int ToBay { get; set; }
    /// <summary>
    /// 层
    /// </summary>
    [ProtoMember(6)]
    public int ToLevel { get; set; }
    /// <summary>
    /// 任务号
    /// </summary>
    [ProtoMember(7)]
    public string JobID { get; set; }
    /// <summary>
    /// 状态 0 未启动 1 已启动 2 完成
    /// </summary>
    [ProtoMember(18)]
    public int Status { get; set; }

    /// <summary>
    /// 站台号
    /// </summary>
    [ProtoMember(8)]
    public int FromStation2 { get; set; }
    /// <summary>
    /// 输送线站台
    /// </summary>
    [ProtoMember(9)]
    public int FromTagNumber2 { get; set; }
    /// <summary>
    /// 排2
    /// </summary>
    [ProtoMember(10)]
    public int ToBank2 { get; set; }
    /// <summary>
    /// 列2
    /// </summary>
    [ProtoMember(11)]
    public int ToBay2 { get; set; }
    /// <summary>
    /// 层2
    /// </summary>
    [ProtoMember(12)]
    public int ToLevel2 { get; set; }
    /// <summary>
    /// 任务ID
    /// </summary>
    [ProtoMember(13)]
    public string JobID2 { get; set; }
    /// <summary>
    /// 任务号2
    /// </summary>
    [ProtoMember(14)]
    public int JobNumber2 { get; set; }







    /// <summary>
    /// 堆垛机任务号
    /// </summary>
    [ProtoMember(15)]
    public int JobNumber { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [ProtoMember(16)]
    public DateTime? CreateTime { get; set; }




    /// <summary>
    /// 重试次数
    /// </summary>
    [ProtoMember(17)]
    public int RetryCount { get; set; }

    /// <summary>
    /// 是否出错
    /// </summary>
    [ProtoMember(19)]
    public int IsError { get; set; }
    /// <summary>
    /// 启动时间
    /// </summary>
    [ProtoMember(20)]
    public DateTime RunTime { get; set; } = DateTime.Now;
    /// <summary>
    /// 托盘号
    /// </summary>
    [ProtoMember(21)]
    public string Data { get; set; }
    /// <summary>
    /// 错误信息
    /// </summary>

    [ProtoMember(22)]
    public string ErrorMsg { get; set; }
    /// <summary>
    /// 库位1标志
    /// </summary>
    public string StageKey { get; set; }
    /// <summary>
    /// 库位2标志
    /// </summary>
    public string StageKey2 { get; set; }

    public override string ToString()
    {
        return $"JobID {JobID},GroupNumber {EquipNum},FromStation {FromStation},FromTagNumber {FromTagNumber},Bank-Bay-Level {ToBank} {ToBay} {ToLevel}";
    }
}
